<!-- 用户操作 -->
<template>
  <div class="user-operate-wp">
    <el-dropdown placement="bottom" size="medium">
      <div class="el-dropdown-link">
        <div class="img-box">
          <img :src="userImage"/>
        </div>
        <span>欢饮您，{{$g.userInfo().realname}}</span>
      </div>
      <el-dropdown-menu slot="dropdown" class="user-operate-poper">
        <el-dropdown-item class="item-box">
          <div class="item" @click="$refs.editPassword.open()">
            <i class="el-icon-setting"></i>密码修改
          </div>
        </el-dropdown-item>
      </el-dropdown-menu>
    </el-dropdown>
  
    <edit-password ref="editPassword"></edit-password>
  </div>
</template>
<script>

// 修改密码
import editPassword from "@/dialogs/user/edit-password.vue";

import userImage from "@/assets/image/user.png";

export default {
  name: 'user-operate',
  components: {
    editPassword,
  },
  data () {
    return {
      userImage: userImage,
    }
  },
  mounted () {
  },
  methods: {

  }
}
</script>
<style lang="scss" scoped>
.user-operate-wp {
  padding-top: 10px;
  padding-bottom: 10px;

  .el-dropdown-link {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: #627392;
    cursor: pointer;

    .img-box {
      margin-right: 10px;
      padding: 5px;
      width: 30px;
      height: 30px;
      background: #C0C4CC;
      border-radius: 50%;
      box-sizing: border-box;
      img {
        display: block;
        width: 100%;
        height: 100%;
      }
    }
  }
}

.user-operate-poper {
  .item-box {
    .item {
      min-width: 160px;
      box-sizing: border-box;
    }
  }
}
</style>